---
title: Cloudflare KV
editUrl: https://github.com/toolbeam/openauth/blob/master/packages/openauth/src/storage/cloudflare.ts
description: Reference doc for the Cloudflare KV storage adapter.
---

import { Segment, Section, NestedTitle, InlineSection } from 'toolbeam-docs-theme/components'
import { Tabs, TabItem } from '@astrojs/starlight/components'

<div class="tsdoc">
<Section type="about">
Configure OpenAuth to use [Cloudflare KV](https://developers.cloudflare.com/kv/) as a
storage adapter.

```ts
import { CloudflareStorage } from "@openauthjs/openauth/storage/cloudflare"

const storage = CloudflareStorage({
  namespace: "my-namespace"
})


export default issuer({
  storage,
  // ...
})
```
</Section>
---
## Methods
### CloudflareStorage
<Segment>
<Section type="signature">
```ts
CloudflareStorage(options)
```
</Section>
<Section type="parameters">
#### Parameters
- <p><code class="key">options</code> [<code class="type">CloudflareStorageOptions</code>](#cloudflarestorageoptions)</p>
The config for the adapter.
</Section>
<InlineSection>
**Returns** <code class="type">StorageAdapter</code>
</InlineSection>
Creates a Cloudflare KV store.
</Segment>
## CloudflareStorageOptions
<Segment>
<Section type="parameters">
- <p>[<code class="key">namespace</code>](#cloudflarestorageoptions.namespace) <code class="type">KVNamespace</code></p>
</Section>
Configure the Cloudflare KV store that's created.
</Segment>
<NestedTitle id="cloudflarestorageoptions.namespace" Tag="h4" parent="CloudflareStorageOptions.">namespace</NestedTitle>
<Segment>
<Section type="parameters">
<InlineSection>
**Type** <code class="type">KVNamespace</code>
</InlineSection>
</Section>
</Segment>
</div>